<?php

namespace App\Models;


class Member extends Model
{
    use ModelTrait;

    const Education_Background_Map = [
        '高中'   => 1,
        '中专'   => 2,
        '大专'   => 3,
        '本科'   => 4,
        '硕士'   => 5,
        '博士'   => 6,
        '博士后' => 7,
    ];

    const Annual_Income_Map = [

        "5w-10w"  => [5,10],
        "10w-15w" => [10,15],
        "15w-20w" => [15,20],
        "20w-30w" => [20,30],
        "30w-50w" => [30,50],
        "50w以上"  => [50],

    ];

    protected $table = 'member';

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'id',
        'user_id',
        'mobile',
        'email',
        'sex',
        'age',
        'real_name',
        'nick_name',
        'province',
        'city',
        'area',
        'height',
        'weight',
        'body_size',
        'school',
        'wechat_no',
        'wechat_mobile',
        'education_background',
        'education_background_code',
        'birth_year',
        'birth_month',
        'birth_day',
        'annual_income',
        'annual_income_min',
        'annual_income_max',
        'monthly_income',
        'asset_money',
        'asset_house',
        'asset_car',
        'marital_status',
        'child_status',
        'vocation',
        'job',
        'about_me',
        'interest',
        'hope_you',
        'question_answer',
        'identification_no',
        'identification_name',
        'identification_valid_date',
        'profile_photo',
        'upload_profile_photo',
        'about_family',
        'brother_sister',
        'want_child',
        'want_marry',
        'ethnic',
        'constellation',
        'self_introduction',
        'mating_requirement',
        'about_smoke',
        'about_drink',
        'created_at',
        'updated_at',
        'deleted_at',

    ];

    public function member_image()
    {
        return $this->hasMany(MemberImage::class,'member_id','id');
    }

    public function member_favorite_member()
    {
        return $this->hasMany(MemberFavorite::class,'member_id','id');
    }

    public function member_favorite_to_member()
    {
        return $this->hasMany(MemberFavorite::class,'to_member_id','id');
    }

    public function member_thumbs_up_member()
    {
        return $this->hasMany(MemberThumbsUp::class,'member_id','id');
    }

    public function member_thumbs_up_to_member()
    {
        return $this->hasMany(MemberThumbsUp::class,'to_member_id','id');
    }

    public function member_request()
    {
        return $this->hasOne(MemberRequest::class,'member_id','id');
    }

}
